/**
 * 
 */
package com.geezdata.cps.sdk3rd.pinduoduo.request;

import java.util.HashMap;
import java.util.Map;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.geezdata.cps.sdk3rd.common.request.BaseOrderListRequest;
import com.geezdata.cps.sdk3rd.pinduoduo.constant.Constants;

/**
 * @author sszheng
 * @date 创建时间：2017年8月15日 下午4:07:37
 *
 */
public class PinduoduoOrderIncrementRequest extends BaseOrderListRequest {
	private static final Integer DEFAULT_ORDER_STATUS = 5;
	private static final Integer DEFAULT_REFUND_STATUS = 5;
	private static final String PINDUODUO_ORDER_INCREMENT_METHOD_NAME = "pdd.order.number.list.increment.get";
	private static final Integer DEFAULT_PAGE_SIZE = 100;

	@NotBlank(message = "methodName 不能为空！")
	private String methodName = PINDUODUO_ORDER_INCREMENT_METHOD_NAME;
    
	@NotNull(message = "startUpdatedAt 不能为空！")
	private Long startUpdatedAt;
	
	@NotNull(message = "endUpdatedAt 不能为空！")
    private Long endUpdatedAt;
	
	@NotNull(message = "isLuckyFlag 不能为空！")
	private Integer isLuckyFlag;	//1:非抽奖订单 2：抽奖订单
	
	@NotNull(message = "orderStatus 不能为空！")
	private Integer orderStatus = DEFAULT_ORDER_STATUS; 	//订单状态，1：待发货，2：已发货待签收，3：已签收 5：全部
	
	@NotNull(message = "refundStatus 不能为空！")
	private Integer refundStatus = DEFAULT_REFUND_STATUS; 	//售后状态  1：无售后或售后关闭，2：售后处理中，3：退款中，4：退款成功 5：全部
	
	private Integer pageSize = DEFAULT_PAGE_SIZE;	//返回数量，默认100。最大100
	
	private Integer page;		//返回页码 默认1，页码从1开始	PS：当前采用分页返回，数量和页数会一起传，如果不传，则采用默认值
	
	private String platformMerchantId;
	
	private String sessionKey;
	
	private String clientId;
	
	private String clientSecret;
	
	private String authType;

	public PinduoduoOrderIncrementRequest() {
		setMethodName(Constants.METHOD_PINDUODUO_ORDER_INCREMENT);
	}
	public Long getStartUpdatedAt() {
		return startUpdatedAt;
	}

	public void setStartUpdatedAt(Long startUpdatedAt) {
		this.startUpdatedAt = startUpdatedAt;
	}

	public Long getEndUpdatedAt() {
		return endUpdatedAt;
	}

	public void setEndUpdatedAt(Long endUpdatedAt) {
		this.endUpdatedAt = endUpdatedAt;
	}

	public Integer getIsLuckyFlag() {
		return isLuckyFlag;
	}

	public void setIsLuckyFlag(Integer isLuckyFlag) {
		this.isLuckyFlag = isLuckyFlag;
	}

	public Integer getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(Integer orderStatus) {
		this.orderStatus = orderStatus;
	}

	public Integer getRefundStatus() {
		return refundStatus;
	}

	public void setRefundStatus(Integer refundStatus) {
		this.refundStatus = refundStatus;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}
	
	public String getMethodName() {
        return methodName;
    }
	
    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
    
	public String getPlatformMerchantId() {
		return platformMerchantId;
	}
	public void setPlatformMerchantId(String platformMerchantId) {
		this.platformMerchantId = platformMerchantId;
	}
	
	public String getSessionKey() {
		return sessionKey;
	}
	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}
	
	public String getClientId() {
		return clientId;
	}
	public void setClientId(String clientId) {
		this.clientId = clientId;
	}
	
	public String getClientSecret() {
		return clientSecret;
	}
	public void setClientSecret(String clientSecret) {
		this.clientSecret = clientSecret;
	}
	
	public String getAuthType() {
		return authType;
	}
	public void setAuthType(String authType) {
		this.authType = authType;
	}
	public Map<String, Object> getAppParams() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("start_updated_at", getStartUpdatedAt());
		map.put("end_updated_at", getEndUpdatedAt());
		map.put("is_lucky_flag", getIsLuckyFlag());
		map.put("order_status", getOrderStatus());
		map.put("refund_status", getRefundStatus());
		if(getPageSize() != null) {
			map.put("page_size", getPageSize());
		}
		if(getPage() != null) {
			map.put("page", getPage());
		}
		
		return map;
	}
}
